<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('赠送优惠券')}" />
    <th:block th:insert="~{include :: datetimepicker-css}" />
</head>
<body class="hold-transition"><div class="container-fluid mt-2 mb-2">
    <form class="form-horizontal m" id="form-coupon-add">
        <input type="hidden" name="couponId" th:value="${couponId}">
        <div class="form-group row">
            <label class="col-sm-2 col-form-label is-required text-sm-right">用户Id</label>
            <div class="col-sm-6">
                <input name="userId"class="form-control" type="text" required>
            </div>
        </div>
        <div class="row">
            <label class="col-sm-3"></label>
            <div class="col-sm-6">
                <button type="button" class="btn btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
                <button type="button" class="btn btn-danger" onclick="parent.layer.closeAll()"><i class="fa fa-reply-all"></i>关 闭 </button>
            </div>
        </div>
    </form>
</div>
<th:block th:insert="~{include :: footer}" />
<th:block th:insert="~{include :: datetimepicker-js}" />
<script type="text/javascript">
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save("/coupon/give.json", $('#form-coupon-add').serialize());
        }
    }
</script>
</body>
</html>